<?php

/**
 * LevelI18n form base class.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class BaseLevelI18nForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'culture'             => new sfWidgetFormInputHidden(),
      'level_name'          => new sfWidgetFormInput(),
      'level_description'   => new sfWidgetFormTextarea(),
      'vocabulary'          => new sfWidgetFormInput(),
      'fluence'             => new sfWidgetFormInput(),
      'grammar'             => new sfWidgetFormInput(),
      'target_population'   => new sfWidgetFormInput(),
      'structure_and_goals' => new sfWidgetFormInput(),
      'result_at_complete'  => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorPropelChoice(array('model' => 'Level', 'column' => 'id', 'required' => false)),
      'culture'             => new sfValidatorPropelChoice(array('model' => 'LevelI18n', 'column' => 'culture', 'required' => false)),
      'level_name'          => new sfValidatorString(array('max_length' => 45)),
      'level_description'   => new sfValidatorString(),
      'vocabulary'          => new sfValidatorString(array('max_length' => 45)),
      'fluence'             => new sfValidatorString(array('max_length' => 45)),
      'grammar'             => new sfValidatorString(array('max_length' => 45)),
      'target_population'   => new sfValidatorString(array('max_length' => 500)),
      'structure_and_goals' => new sfValidatorString(array('max_length' => 600)),
      'result_at_complete'  => new sfValidatorString(array('max_length' => 600)),
    ));
/*
    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'LevelI18n', 'column' => array('level_name')))
    );
*/
    $this->widgetSchema->setNameFormat('level_i18n[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'LevelI18n';
  }


}
